<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>给组件绑定原生事件</title>
    <script src="../js/vue-dev.js"></script>
</head>
<body>
    <!--如果没有.native修饰符，则不会触发vue实例的方法-->
    <div id="app_native">
        <p>{{parentData}}</p>
        <my-component v-on:click.native="doSomething"></my-component>
    </div>
    <script>
        Vue.component('my-component',{
            template:'<button>点击</button>',
        })
        var app_native = new Vue({
            el:'#app_native',
            data:{
                parentData:0
            },
            methods:{
                doSomething:function () {
                    this.parentData += 1 ;
                }
            }
        })

    </script>


</body>
</html>